-module(shop).
-export([cost/1]).
-export([total/1]).

cost(orange) -> 5;
cost(newspaper) -> 8.

total([{What,N}|T]) -> cost(What) * N + total(T);
total([]) -> 0.